function clock() {
	
	var digital = new Date();
	var intWeekday = digital.getDay();
	var intMonth = digital.getMonth();
	var MonthArray = new Array("January", "February", "March",
	                               "April", "May", "June",
	                               "July", "August", "September",
	                               "October", "November", "December")
	var DayArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday", 
	                         "Thursday", "Friday", "Saturday")
	var weekday = DayArray[intWeekday]; 
	var month = MonthArray[intMonth];
	var day = digital.getDate();
	var year = digital.getFullYear();
	var hours = digital.getHours();
	var minutes = digital.getMinutes();
	var seconds = digital.getSeconds();
	var amOrPm = "AM";
	if (hours > 11) amOrPm = "PM";
	if (hours > 12) hours = hours - 12;
	if (hours == 0) hours = 12;
	if (minutes <= 9) minutes = "0" + minutes;
	if (seconds <= 9) seconds = "0" + seconds;
	dispTime = '<b>' + weekday + ', ' + month + ' ' + day + ', ' + year + ' ' + hours + ":" + minutes + ":" + seconds + " " + amOrPm +'</b>';
	document.getElementById('pendule').innerHTML = dispTime;
	setTimeout("clock()", 1000);
}

function init() {

	var zIndex = 0;

	// BEGIN :: Non-draggable targets
	var col1Target = new YAHOO.util.DDTarget("Column1", "Group1");
	var col2Target = new YAHOO.util.DDTarget("Column2", "Group1");
	var col3Target = new YAHOO.util.DDTarget("Column3", "Group1");
	// END :: Non-draggable targets

	// BEGIN :: Objects to drag
	var rec0 = document.getElementById("Rec0");
	var rec1 = document.getElementById("Rec1");
	var rec2 = document.getElementById("Rec2");
	var rec3 = document.getElementById("Rec3");
	var rec4 = document.getElementById("Rec4");
	var rec5 = document.getElementById("Rec5");
	var rec6 = document.getElementById("Rec6");

	var rec0Drag = new YAHOO.util.DDProxy(rec0, "Group1");
	rec0Drag.setHandleElId("Rec0Handle");
	var rec1Drag = new YAHOO.util.DDProxy(rec1, "Group1");
	rec1Drag.setHandleElId("Rec1Handle");
	var rec2Drag = new YAHOO.util.DDProxy(rec2, "Group1");
	rec2Drag.setHandleElId("Rec2Handle");
	var rec3Drag = new YAHOO.util.DDProxy(rec3, "Group1");
	rec3Drag.setHandleElId("Rec3Handle");
	var rec4Drag = new YAHOO.util.DDProxy(rec4, "Group1");
	rec4Drag.setHandleElId("Rec4Handle");
	var rec5Drag = new YAHOO.util.DDProxy(rec5, "Group1");
	rec5Drag.setHandleElId("Rec5Handle");
	var rec6Drag = new YAHOO.util.DDProxy(rec6, "Group1");
	rec6Drag.setHandleElId("Rec6Handle");
	// END :: Objects to drag
	
	// BEGIN :: Event handlers
	var marker, container;
	var lastRectNode = [];
	marker = document.createElement("div");	

	rec0Drag.startDrag = rec1Drag.startDrag = rec2Drag.startDrag = rec3Drag.startDrag = rec4Drag.startDrag = rec5Drag.startDrag = rec6Drag.startDrag = function(x, y) {
		var dragEl = this.getDragEl(); 
		var el = this.getEl();
		container = el.parentNode;

		el.style.display = "none";
		dragEl.style.zIndex = ++zIndex;
		dragEl.innerHTML = el.innerHTML;
		dragEl.style.color = "#ebebeb";
		dragEl.style.backgroundColor = "#fff";
		dragEl.style.textAlign = "center";
		marker.style.display = "none";
		marker.style.height = YAHOO.util.Dom.getStyle(dragEl, "height");	
		marker.style.width = YAHOO.util.Dom.getStyle(dragEl, "width");
		marker.style.margin = "5px"; 
		marker.style.marginBottom = "20px"; 
		marker.style.border = "2px dashed #7e7e7e";
		marker.style.display= "block";
		container.insertBefore(marker, el);
	}
	col1Target.onDragEnter = col2Target.onDragEnter = col3Target.onDragEnter = rec0Drag.onDragEnter = rec1Drag.onDragEnter = rec2Drag.onDragEnter = rec3Drag.onDragEnter = rec4Drag.onDragEnter = rec5Drag.onDragEnter = rec6Drag.onDragEnter = function(e, id) {
		var el = document.getElementById(id);
		if (id.substr(0, 6)	=== "Column") {
			el.appendChild(marker);
		} else {
			container = el.parentNode;
			container.insertBefore(marker, el);
		}
	}
	rec0Drag.onDragOut = rec1Drag.onDragOut = rec2Drag.onDragOut = rec3Drag.onDragOut = rec4Drag.onDragOut = rec5Drag.onDragOut = rec6Drag.onDragOut = function(e, id) {
		var el = document.getElementById(id);
		lastRectNode[container.id] = getLastNode(container.lastChild);

		if (el.id === lastRectNode[container.id].id) {
			container.appendChild(marker);
		}	
	}
	rec0Drag.endDrag = rec1Drag.endDrag = rec2Drag.endDrag = rec3Drag.endDrag = rec4Drag.endDrag = rec5Drag.endDrag = rec6Drag.endDrag = function(e, id) {
		var el = this.getEl(); 
		try {
			marker = container.replaceChild(el, marker);
		} catch(err) {
			marker = marker.parentNode.replaceChild(el, marker);
		}	
		el.style.display = "block";
	}
	// END :: Event handlers
	
	// BEGIN :: Helper methods
	var getLastNode = function(lastChild) {
			var id = lastChild.id;
			if (id && id.substring(0, 3) === "Rec") {
				return lastChild;
			} 
			return getLastNode(lastChild.previousSibling);
	}
	var isEmpty = function(el) {
			var test = function(el) { 
				return ((el && el.id) ? el.id.substr(0, 3) == "Rec" : false);
			} 
			var kids = YAHOO.util.Dom.getChildrenBy(el, test);
			return (kids.length == 0 ? true : false);
	}
	// END :: Helper methods
}